﻿using System;

namespace ZYCommon
{
    

    public class Format_Max : StringDataFormatItem
    {
        public override bool CanEditSetting()
        {
            return true;
        }

        public override bool Test(string strValue)
        {
            return (Convert.ToDouble(strValue) <= Convert.ToDouble(base.strSetting));
        }

        public override string DisplayName
        {
            get
            {
                return ("最大不得超过" + base.strSetting);
            }
        }

        public override string Name
        {
            get
            {
                return "max";
            }
        }

        public override string SettingValue
        {
            get
            {
                return base.strSetting;
            }
            set
            {
                try
                {
                    if (value == null)
                    {
                        base.strSetting = "0";
                    }
                    else
                    {
                        Convert.ToDouble(value);
                        base.strSetting = value;
                    }
                }
                catch
                {
                }
            }
        }
    }
}

